-- GENERATED SPELL FOR [Auchenai Warrior] --


function spell0_21852(pUnit, Event) --@Knockdown,n/a--
pUnit:FullCastSpellOnTarget(37592,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21852', 1000, 1)
end

function spell1_21852(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(38619,pUnit)
pUnit:RegisterEvent('Sorts_21852', 591, 1)
end

function spell2_21852(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(38618,pUnit)
pUnit:RegisterEvent('Sorts_21852', 2000, 1)
end

function Sorts_21852(pUnit, Event)
local choix_sorts_21852 = math.random(0, 2)
if choix_sorts_21852 == 0 then
pUnit:RegisterEvent('spell0_21852', 1, 1)
end
if choix_sorts_21852 == 1 then
pUnit:RegisterEvent('spell1_21852', 1, 1)
end
if choix_sorts_21852 == 2 then
pUnit:RegisterEvent('spell2_21852', 1, 1)
end
end

function mob21852_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21852', math.random(1500, 3000), 1)
end

function mob21852_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21852_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21852_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21852, 1, 'mob21852_Action')
RegisterUnitEvent(21852, 2, 'mob21852_Leave')
RegisterUnitEvent(21852, 3, 'mob21852_Kill')
RegisterUnitEvent(21852, 4, 'mob21852_Die')
